﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:BindingConverters="clr-namespace:Meridian.BindingConverters">
    <BindingConverters:BeginTimeConverter x:Key="BeginTimeConverter"/>
    <DataTemplate x:Key="MyAudioMiniItemTemplate">
        <Grid Focusable="False" ToolTip="{Binding FullTitle}">
            <Grid.RenderTransform>
                <TranslateTransform />
            </Grid.RenderTransform>
            <Grid.Triggers>
                <EventTrigger RoutedEvent="Grid.Loaded">
                    <BeginStoryboard>
                        <Storyboard>
                            <Storyboard>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="-15"/>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0" Value="0"/>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard BeginTime="{Binding Converter={StaticResource BeginTimeConverter}}">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0">
                                        <EasingDoubleKeyFrame.EasingFunction>
                                            <ExponentialEase EasingMode="EaseOut" Exponent="6"/>
                                        </EasingDoubleKeyFrame.EasingFunction>
                                    </EasingDoubleKeyFrame>
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
                                    <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1">
                                        <EasingDoubleKeyFrame.EasingFunction>
                                            <ExponentialEase EasingMode="EaseOut" Exponent="6"/>
                                        </EasingDoubleKeyFrame.EasingFunction>
                                    </EasingDoubleKeyFrame>
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger>
            </Grid.Triggers>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <TextBlock Text="{Binding Title}" FontFamily="../Fonts/#Segoe WP" FontSize="12" TextTrimming="CharacterEllipsis"/>
            <TextBlock Text="{Binding Artist}" FontFamily="../Fonts/#Segoe WP" FontSize="12" TextTrimming="CharacterEllipsis" Opacity="0.5" Grid.Column="2"/>
        </Grid>
    </DataTemplate>
</ResourceDictionary>